package com.bysc.commonutils.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum BookCourseEnum {

    //“0未审核”，“1通过”，“2没通过”
    UNAUDITED(0,"未审核"),
    PASSED(1,"通过"),
    NOT_PASSED(2,"未通过");

    private final Integer id;
    private final String value;
    public static String getValueById(int bookCourseId) {
        for (BookCourseEnum bookCourseEnum : BookCourseEnum.values()) {
            if (bookCourseEnum.getId() == bookCourseId) {
                return bookCourseEnum.getValue();
            }
        }
        throw new IllegalArgumentException ("Invalid bookCourseId: " + bookCourseId);
    }
}
